home *** CD-ROM | disk | FTP | other *** search
/ Game Cracker (Expanded Edition) / Game Cracker (Expanded Edition).iso / cracks / IN973824.ZIP / INC_CD.ASM < prev    next >
Assembly Source File  |  1998-07-28  |  5KB  |  138 lines

  1. ; R!SC File patcher v1.01 28-07-98
  2. ; asm stylee!!!
  3. ; Tasm inc_cd
  4. ; Tlink /t inc_cd
  5. ; run inc_cd in incoming dir
  6. ; blah blah blah
  7. ; free to a good home
  8.  
  9.  
  10.  
  11. .MODEL TINY
  12. .CODE
  13. .286
  14. ORG 100h
  15.  
  16.  
  17. start:
  18.                 mov     ah, 9                ;print title
  19.                 mov     dx, offset Mytitle
  20.                 int     21h               ;yah yah yah
  21.  
  22.                 mov dx, offset filename  ;pointer to asciiz filename
  23.                 mov ax, 4301h            ;set file attribs
  24.                 xor cx,cx                ;clr them all
  25.                 int 21h                  ; call dos int make sure we can write to the file
  26.                                          ; cus it could ave been read only an fucked us up
  27.  
  28.                 mov     ax, 3D02h        ;Open File
  29.                 mov     dx, offset filename
  30.         int     21h
  31.                 jnb     Ok               ;jump if everything ok
  32.  
  33.  
  34.                 mov     ah, 9            ;error with file
  35.                 mov     dx, offset error
  36.         int     21h
  37.                 mov     ax, 4C01h        ;Exit with error
  38.         int     21h
  39. ;_______________________________________________________________
  40. ;check file size to see if were trying to patch same version
  41. Ok:
  42.                 mov     bx, ax          ; move file handle
  43.             mov     ax, 4200h    ; seek 
  44.                 mov     cx, 0eh         ; high byte ov file size 
  45.                 mov     dx,0dbffh       ; eof -1 file size 0xedc00
  46.  
  47.                 int     21h             ; seek 1 byte b4 eof
  48.  
  49.                 mov     ax, 3f00h       ; read from file
  50.                 mov     cx, 03h         ; read 3 many bytes
  51.                 mov     dx, offset readbuffer    ; offset to read bytes
  52.  
  53.                 int     21h        ;returns in ax number of bytes succsesfully read
  54.  
  55.                 cmp     ax,1       ;if ax= 1 we have the right file size
  56.                 je      sizepassed ; if it were higher, files too big
  57.                    ; if it were lower, files too small
  58.                                    ; if == 1 size o.k. carry on with patch
  59.  ;------------------------------------------------------------------------
  60.  ;file wrong size, letz get outta here!
  61.  
  62.                 mov     ah, 9               ; print to screen
  63.                 mov     dx, offset error2   ; message
  64.         int     21h
  65.                 mov     ax, 4C01h           ;Exit with error
  66.         int     21h
  67.  
  68. sizepassed:
  69.  ;------------------------------------------------------------------------
  70.  ;seek & write patch #1
  71.  
  72.                 mov     ax, 4200h    ;file seek
  73.                 mov     cx, 2            ; hi order word of offset
  74.                 mov     dx, 049a6h          ; lo order word of offset
  75.                 int     21h         ;thats 0x249a6 to you and me
  76.                 mov     ax, 4000h        ;Write to file
  77.                 mov     cx, 1            ;number of bytes to write
  78.                 mov     dx, offset BTW1
  79.                 int     21h
  80.  ;------------------------------------------------------------------------
  81.  ;seek & write patch #2
  82.  
  83.                 mov     ax, 4200h    ;file seek
  84.                 mov     cx, 4            
  85.                 mov     dx, 093a2h      ;0x439a2   
  86.                 int     21h
  87.                 mov     ax, 4000h    ;Write to file         
  88.                 mov     cx, 1          
  89.                 mov     dx, offset BTW2
  90.                 int     21h
  91.  ;------------------------------------------------------------------------
  92.  ;seek & write patch #3
  93.  
  94.                 mov     ax, 4200h    ;file seek
  95.                 mov     cx, 4            
  96.                 mov     dx, 09a92h      ;0x49a92   
  97.                 int     21h
  98.                 mov     ax, 4000h    ;Write to file         
  99.                 mov     cx, 1          
  100.                 mov     dx, offset BTW3
  101.                 int     21h
  102.  ;------------------------------------------------------------------------
  103.  ; gwon, all done, letz go and play
  104.  
  105.                 mov     ax, 3E00h           ;Close file
  106.                 int     21h
  107.  
  108.  
  109.                 mov     ah, 9               ; Show msg
  110.                 mov     dx, offset done
  111.                 int     21h
  112.  
  113.                 mov     ax, 4C00h           ; All Done And Exit 
  114.                 int     21h                 ;l8trs/all sorted
  115.  
  116. ;_______________________________________________________________
  117. ; oh, i wonder...
  118.  
  119. Mytitle           db  "Incoming English Version ",0dh,0ah,0dh,0ah
  120.                 db  "  Cracked by -R!SC- With help from Static Vengeance(a txt tut) ",0dh,0ah,0dh,0ah,"$"
  121.  
  122.  
  123. error           db '  error: cant find file ? ',0Dh,0Ah,'$'
  124. error2          db '  error: file wrong size, should be 973824 bytes ',0Dh,0Ah,'$'
  125.  
  126. filename        db 'incoming.exe',0
  127.  
  128. done            db ' Groovy! Patch Succsessful, 3 bytes changed...'  , 0Dh,0Ah,'$'
  129.  
  130. BTW1    db 0ebh        ;jmp  /btw, BTW means Byte(s) to write
  131. BTW2    db 0ebh        ;jmp
  132. BTW3    db 0ebh        ;jmp 
  133.  
  134. readbuffer db "  RiSC RtL 98 HehHeh   "
  135.  
  136.  
  137.          end    start
  138.